package com.qfedu.sca.feign;

import com.qfedu.sca.common.vo.R;
import org.springframework.cloud.openfeign.FeignClient;
import org.springframework.http.MediaType;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestParam;
import org.springframework.web.bind.annotation.RequestPart;
import org.springframework.web.multipart.MultipartFile;

import javax.servlet.http.HttpServletRequest;

/**
 * 千锋Java,为你而生！
 *
 * @Author: Feri
 * @Date:2024/11/7 14:55
 * @Modified:
 */
@FeignClient(name = "xingProvider")
public interface HelloService {
    /**
     * 设置服务提供者对应的api
     * 要求：
     * 1.返回值一样
     * 2.请求方式和请求路径 正确
     * 3.参数格式 要求 注解不能省略
     * */
    @GetMapping("server/hello/hi")
    String hi();

    //文件上传 配置
    @PostMapping(value = "server/hello/upload",consumes = MediaType.MULTIPART_FORM_DATA_VALUE)
    R upload(@RequestPart("file") MultipartFile file);
}
